{extend name="public/admin_base"}
{block name="main"}
<div class="layui-tab layui-tab-brief" lay-filter="demoTitle">
    <ul class="layui-tab-title site-demo-title">
        <li class="layui-this">分类列表</li>
    </ul>
    <div class="layui-body layui-tab-content site-demo site-demo-body">
        <div class="layui-tab-item layui-show">
            <div class="layui-main">
                <div id="LAY_preview">
                    <button data-method="setTop" class="layui-btn open_layer" data-href='{:url("save_category")}'>添加分类</button>
                    <table class="layui-table" lay-even="" lay-skin="nob">
                    <colgroup>
                        <col width="150">
                        <col width="150">
                        <col width="200">
                        <col>
                    </colgroup>
                    <thead>
                    <tr>
                        <th>ID</th>
                        <th>名字</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    {volist name="category" id="vo"}
                    <tr>
                        <td>{$vo.id}</td>
                        <td>{$vo.level|str_repeat=' -- ', ###}{$vo.name}</td>
                        <td><button data-method="setTop" class="layui-btn layui-btn-mini open_layer" data-href='{:url("save_category", ["id" => $vo["id"]])}'>编辑分类</button></td>
                    </tr>
                    {/volist}
                    </tbody>
                </table>
                </div>
            </div>
        </div>
    </div>
</div>
{/block}